<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>订单列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css">
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="${ctxStatic}/shopcartstatic/css/easyLife/font-awesome.min.css">
    <link rel="stylesheet" href="${ctxStatic}/shopcartstatic/css/easyLife/main.css">
    <link rel="stylesheet" href="${ctxStatic}/shopcartstatic/css/easyLife/order.css">
    <link rel="stylesheet" href="${ctxStatic}/shopcartstatic/css/easyLife/theme-color.css">
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<header class="zyw-header">
    <div class="zyw-container white-color">
        <div class="head-l"><a href="javascript:window.history.back(-1)" target="_self"><img src="${ctxStatic}/shopcartstatic/images/head-return.svg" alt=""></a></div>
        <h1>订单列表</h1>
        <div class="head-r"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></div>
    </div>
</header>
<section class="zyw-container">
    <div class="weui-tab">

        <div class="weui-tab__bd">
            <div id="order_all" class="weui-tab__bd-item weui-tab__bd-item--active">

                <div class="order-group">
                    <c:forEach items="${list}" var="a">
                    <div class="order-group-item clearfix" style="margin-top: 10px;" onclick="orderd('${a.id}')">
                        <div class="order-item-box">
                            <h4 class="order-item-id" >订单号：${a.sn}
                                <c:if test="${a.status==0}">
                                <span class="order-item-state theme-color pull-right">未支付</span>
                                </c:if>
                                <c:if test="${a.status==1}">
                                    <span class="order-item-state theme-color pull-right">已支付</span>
                                </c:if>
                            </h4>

                        </div>
                        <p class="text-right order-item-sum">合计￥${a.totals}</p>
                        <div class="order-item-btn pull-right">
                            <button class="btn btn-sm btn-default" onclick="orderdel('${a.id}')">删除订单</button>
                            <c:if test="${a.status==0}">
                            <button class="btn btn-sm btn-primary theme-bdcolor theme-bgcolor" onclick="orderp('${a.id}')">付款</button>
                            </c:if>
                            <c:if test="${a.status==1}">
                                <button class="btn btn-sm btn-primary theme-bdcolor theme-bgcolor" onclick="orderp('${a.id}')">已付款</button>
                            </c:if>
                        </div>
                    </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </div>
</section>
<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js"></script>
<script src="${ctxStatic}/shopcartstatic/js/easyLife/bootstrap.min.js"></script>
<script>
    function orderdel(id) {
        window.location.href="/shop/client/orderdel?id="+id;
    }
    function orderp(id) {
        window.location.href="/shop/client/order-create?id="+id;
    }
</script>
</body>
</html>
